#!/usr/bin/env python3.0

import curses
import curses.textpad

def main():
	# initialize curses.
	stdscr = curses.initscr()
	curses.cbreak()
	curses.noecho()
	stdscr.keypad(True)

	height = curses.LINES;
	width = curses.COLS;

	# it cannot receive multibyte characters.
	win = curses.newwin(height//2,width//2,5,10)
	text = curses.textpad.Textbox(win)
	win.refresh()

	text.edit()

	str = text.gather()

	curses.meta(True)
	curses.endwin()

	print("you endered {0:s}".format(str))


main()
